package com.zhanglijie.base.sync.Lock;

import lombok.Data;

/**
 * @author zhanglijie
 * @version 1.0
 * @since 1.1.0 2022/6/9 0009 0:04
 */
@Data
public class MarkWord implements Cloneable {
    //锁标记
    private String lockFlag = "01";
    //是否偏向锁
    private String biasedLock = "1";
    private String epoch;
    private String age;

    public String getBiasedLock() {
        return biasedLock;
    }

    public void setBiasedLock(String biasedLock) {
        this.biasedLock = biasedLock;
    }

    public long getThreadId() {
        return threadId;
    }

    public void setThreadId(long threadId) {
        this.threadId = threadId;
    }

    private volatile long threadId = -1;

    //指向lockrecord的指针
    private volatile LockRecord ptrLockRecord;
    //指向monitor的指针
    private ObjectMonitor ptrMonitor  ;

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    private volatile String status = null;//膨胀状态
    @Override
    public Object clone() throws CloneNotSupportedException {
        Object clone = super.clone();
        return clone;
    }
    public String getLockFlag() {
        return lockFlag;
    }

    public void setLockFlag(String lockFlag) {
        this.lockFlag = lockFlag;
    }

    public LockRecord getPtrLockRecord() {
        return ptrLockRecord;
    }

    public void setPtrLockRecord(LockRecord ptrLockRecord) {
        this.ptrLockRecord = ptrLockRecord;
    }

    public ObjectMonitor getPtrMonitor() {
        return ptrMonitor;
    }

    public void setPtrMonitor(ObjectMonitor ptrMonitor) {
        this.ptrMonitor = ptrMonitor;
    }



}
